<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
    <!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
    <!-- <meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="./assets/buefy.min.css">
    <title>刷量工具</title>
    <style>
      .this-times .control .select select {
        min-width: 100px;
      }
      .this-gaps .control .select select {
        min-width: 75px;
      }
      .m-sticky {
        position: sticky;
        top: 0;
        background-color: #FFF;
        z-index: 1;
      }
    </style>
  </head>
  <!-- <a href="http://localhost:2580/detail">detail</a> -->
  <body>
    <div id="app">
      <div class="container is-fluid">
        <section class="hero m-sticky">
          <div class="hero-body">
            <nav class="level">
              <!-- Left side -->
              <div class="level-left">
                <div style="height: 40px;" class="level-item is-flex-direction-column is-justify-content-space-around">
                  <p class="title is-5">国际金融报</p>
                  <p class="has-text-success is-5">{{date}}</p>
                </div>
                <div class="level-item">
                  <div class="field has-addons">
                    <p class="control">
                      <input class="input is-primary" type="text" v-model:value="name" placeholder="输入作者姓名">
                    </p>
                    <p class="control">
                      <button :class="{'button': true, 'is-primary': true, 'is-loading': loading}" @click="onSearch">搜索</button>
                    </p>
                  </div>
                </div>
                <!-- <div class="level-item">
                  <button class="button" @click="reStart">刷新</button>
                </div> -->
              </div>
    
              <!-- Right side -->
              <div class="level-right">
                <p class="level-item">
                  <b-field grouped>
                      <b-field type="is-success" class="this-gaps" label="处理间隔" label-position="on-border">
                        <b-select size="is-small" v-model:value="gaps" rounded placeholder="间隔">
                          <option v-for="n in [1, 5, 10, 20, 30, 45, 60]" :key="n" :value="n">{{n}}</option>
                        </b-select>
                        <b-select size="is-small" v-model:value="type" rounded placeholder="类型">
                          <option value="sec">秒</option>
                          <option value="min">分</option>
                          <option value="hour">时</option>
                        </b-select>
                      </b-field>

                      <b-field class="this-times" type="is-success" label="处理次数" label-position="on-border">
                        <b-select style="min-width: 100px;" size="is-small" v-model:value="times" rounded placeholder="处理次数">
                          <option v-for="n in [5, 10, 15, 20, 30, 40, 50, 60, 80, 100]" :key="n" :value="n">{{n}}</option>
                        </b-select>
                      </b-field>
                  </b-field>
                </p>
              </div>
            </nav>
          </div>
        </section>
        <div class="columns">
          <div class="column is-12">
            <table class="table is-fullwidth">
              <thead>
                <tr>
                  <th>序号</th>
                  <th>文章标题</th>
                  <th>发布日期</th>
                  <th>最新浏览量</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <template v-if="list.length > 0">
                  <table-line :config="config" v-for="item in list" :key="item.fileID" :id="item.fileID" :title="item.title" :date="item.publishTime" />
                </template>
                <tr v-else>
                  <td class="has-text-grey-light" colspan="5" style="text-align: center;">暂无数据...</td>
                </tr>
              </tbody>
            </table>
            <!-- <nav class="pagination is-rounded" role="navigation" aria-label="pagination">
              <a class="pagination-previous">Previous</a>
              <a class="pagination-next">Next page</a>
              <ul class="pagination-list">
                <li><a class="pagination-link" aria-label="Goto page 1">1</a></li>
                <li><a class="pagination-link" aria-label="Goto page 45">2</a></li>
                <li><a class="pagination-link is-current" aria-label="Page 46" aria-current="page">3</a></li>
                <li><span class="pagination-ellipsis">&hellip;</span></li>
                <li><a class="pagination-link" aria-label="Goto page 86">20</a></li>
              </ul>
            </nav> -->
          </div>
        </div>
      </div>
    </div>
    <script src="./assets/vue.js"></script>
    <script src="./assets/buefy.min.js"></script>
    <script src="./renderer.js"></script>
  </body>
</html>
